moving average

Terms from Artificial Intelligence: humans at the heart of algorithms

Page numbers are for draft copy at present; they will be replaced with correct numbers when final book is formatted. Chapter numbers are correct and will not change now.

A moving average of time series or sequential data is a new time series where each element is a weighted average of the last N items in the original series. the simplest case is a straight average, that is That is, if xi is the original series, the new series yi is just the arithmetic mean of xi, xi-1, xi-2, ... xi-(N-1). For example, we might use a 7 day moving average to cancel day-of-the-week effects. More generally, yi is calculated using weights wk (0≤k<N):

    yi = w0xi + w1xi-1 + w2xi-2 + ... wN-1xi-(N-1)

Used in Chap. 10: page 151; Chap. 14: pages 223, 231, 233, 234, 235

Covid-19 deaths for UK in 2020 – daily data is very noisy, but a 7-day moving average is far more stable (adapted from: https://coronavirus.data.gov.uk/details/deaths).